package com.wuchengdong.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wuchengdong.web.mapper.UserMapper;
import com.wuchengdong.web.pojo.User;
import com.wuchengdong.web.service.UserService;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Override
    public User checkPassword(User user) {
        LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(User::getName, user.getName()).eq(User::getPassword, user.getPassword());
        return this.getOne(queryWrapper);
    }
}